package com.gagakuai.transport.bootstrap;

import com.gagakuai.transport.channel.Channel;
import com.gagakuai.transport.channel.ChannelHandler;
import com.gagakuai.transport.channel.EventLoopGroup;
import com.gagakuai.utils.internal.ObjectUtil;

import java.net.SocketAddress;

/*
 * @description: 启动类的配置信息
 * @author: houhong
 * @create: 2024-03-29 22:28
 */
public abstract class AbstractBootstrapConfig<B extends AbstractBootstrap<B,C>, C extends Channel>{


    protected final B bootstrap;



    protected AbstractBootstrapConfig(B bootstrap) {
        this.bootstrap = ObjectUtil.checkNotNull(bootstrap, "bootstrap");
    }


    public final SocketAddress localAddress() {
        return bootstrap.localAddress();
    }

    public  final  ChannelFactory<? extends Channel> channelFactory(){

        return bootstrap.channelFactory();
    }


    public final ChannelHandler handler() {
        return bootstrap.handler();
    }



    public final EventLoopGroup group() {
        return bootstrap.group();
    }

}
